const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('act_dmn_decision_table', {
    id: {
      type: DataTypes.STRING(255),
      allowNull: false,
      primaryKey: true,
      field: 'ID_'
    },
    name: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'NAME_'
    },
    version: {
      type: DataTypes.INTEGER,
      allowNull: true,
      field: 'VERSION_'
    },
    key: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'KEY_'
    },
    category: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'CATEGORY_'
    },
    deploymentId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'DEPLOYMENT_ID_'
    },
    tenantId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'TENANT_ID_'
    },
    resourceName: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'RESOURCE_NAME_'
    },
    description: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'DESCRIPTION_'
    }
  }, {
    sequelize,
    tableName: 'act_dmn_decision_table',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "ID_" },
        ]
      },
      {
        name: "ACT_IDX_DEC_TBL_UNIQ",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "KEY_" },
          { name: "VERSION_" },
          { name: "TENANT_ID_" },
        ]
      },
    ]
  });
};
